'''
Created on Jun 26, 2011

@author: User
'''


from cliques.randomCliqueSearch import randomCliqueSearch
from cliques.knownDegreeSearch import knownDegreeSearch
from cliques.cliqueStarSearch import cliqueStarSearch
from cliques.cliqueSearchLowerbound import CliqueSearchLowerbound
from cliques.mdp.offlineLimitedSampling import OfflineLimitedSampling
from cliques.mdp.limitedSampling import LimitedSampling
from cliques.mdp.mdpBasedSearch import mdpBasedSearch
from cliques.rls.rls import RLS
import logging
import cliques.dynamicRunner
from graphUtils.scenarioGenerator import ScenarioGenerator
from cliques.mdp.cstarTieBreaker import CliqueStarTieBreaker
from cliques.mdp.cstarTieBreaker import CliqueStarTieBreakerUniform 
from cliques.mdp.monteCarloTreeSearch import MonteCarloTreeSearch
def main():
    logging.basicConfig(level=logging.INFO  )
    
    # Missing experiments
    # 1. Standard, random, 100 node,12 degree,5 clique size
    # 1.1 Deterministic
    # 1.2 Noise levels - Done
    # 2. Standard, random, 100 node,12 degree,clique size 5-9
    # 3. Standard, random, 100,200,300,400 nodes
    generator = ScenarioGenerator("../../resources/scenarios/random")

    logging.info(" --------- Experiment 3 -------");
    algorithm_tuple = (RLS(),RLS(tie_breaking="Degree"),\
                       randomCliqueSearch(),knownDegreeSearch(),\
                       cliqueStarSearch(),CliqueSearchLowerbound(),\
                       mdpBasedSearch(CliqueStarTieBreaker,"Clique*+ties-%d-%d-%f" % (1, 250,0.5),1, 250, noise=0.5),\
                       mdpBasedSearch(CliqueStarTieBreaker,"Clique*+ties-%d-%d-%f" % (2, 250,0.5),2, 250, noise=0.5),\
                       mdpBasedSearch(CliqueStarTieBreaker,"Clique*+ties-%d-%d-%f" % (3, 250,0.5),3, 250, noise=0.5),\
                       mdpBasedSearch(CliqueStarTieBreaker,"Clique*+ties-%d-%d-%f" % (4, 250,0.5),4, 250, noise=0.5),\
                       mdpBasedSearch(CliqueStarTieBreaker,"Clique*+ties-%d-%d-%f" % (5, 250,0.5),5, 250, noise=0.5),\
#                       mdpBasedSearch(OfflineLimitedSampling,"RClique*-%d-%d-%f" % (1, 250,0.5),1, 250, noise=0.5),\
#                       mdpBasedSearch(OfflineLimitedSampling,"RClique*-%d-%d-%f" % (2, 250,0.5),2, 250, noise=0.5),\
#                       mdpBasedSearch(OfflineLimitedSampling,"RClique*-%d-%d-%f" % (3, 250,0.5),3, 250, noise=0.5),\
#                       mdpBasedSearch(OfflineLimitedSampling,"RClique*-%d-%d-%f" % (4, 250,0.5),4, 250, noise=0.5),\
#                       mdpBasedSearch(OfflineLimitedSampling,"RClique*-%d-%d-%f" % (5, 250,0.5),5, 250, noise=0.5),\
#                       mdpBasedSearch(CliqueStarTieBreakerUniform,"Clique*+ties-%d-%d(p)" % (3, 250),1, 250),\

#                       mdpBasedSearch(MonteCarloTreeSearch,"MCTS-%d-%d(p)" % (1, 250),5, 250),\
#                       mdpBasedSearch(MonteCarloTreeSearch,"MCTS-%d-%d(p)" % (2, 250),5, 250),\
#                       mdpBasedSearch(MonteCarloTreeSearch,"MCTS-%d-%d(p)" % (3, 250),5, 250),\
#                       mdpBasedSearch(MonteCarloTreeSearch,"MCTS-%d-%d(p)" % (4, 250),5, 250),\
#                       mdpBasedSearch(MonteCarloTreeSearch,"MCTS-%d-%d(p)" % (5, 250),5, 250),\
                       )                                                
    runner = cliques.dynamicRunner.dynamicRunner(\
        "random-noise-effect",\
        generator,\
        folder_name = "random",\
        algorithms=algorithm_tuple,\
        nodes_range=[200,300,400],\
        edge_factors=[12],\
        k_range=[5],\
        enable_profiling=False,
        path_prefix="../..")
    
    runner.run()  
    
    
    
if __name__ == '__main__':
    main()